From 52bb2e5a28610dcafbfc296a79a4675898e5ac08 Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Wed, 28 Sep 2011 19:28:19 +0000 Subject: [PATCH] Followup r98339 Don't try and remove the user_options column in SQLite Added 'user.user_options' to ignores --- includes/installer/SqliteUpdater.php | 1 - maintenance/sqlite/archives/initial-indexes.sql | 5 ++--- tests/phpunit/includes/db/DatabaseSqliteTest.php | 9 +++++---- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/includes/installer/SqliteUpdater.php b/includes/installer/SqliteUpdater.php index a5fba27437..d43e40906c 100644 --- a/includes/installer/SqliteUpdater.php +++ b/includes/installer/SqliteUpdater.php @@ -67,7 +67,6 @@ class SqliteUpdater extends DatabaseUpdater { array( 'addTable', 'globalnamespaces', 'patch-globalnamespaces.sql' ), array( 'addTable', 'globalinterwiki', 'patch-globalinterwiki.sql' ), array( 'doMigrateUserOptions' ), - array( 'dropField', 'user', 'user_options', 'patch-drop-user_options.sql' ), ); } diff --git a/maintenance/sqlite/archives/initial-indexes.sql b/maintenance/sqlite/archives/initial-indexes.sql index 2573ca13d9..0c0cef8857 100644 --- a/maintenance/sqlite/archives/initial-indexes.sql +++ b/maintenance/sqlite/archives/initial-indexes.sql @@ -3,7 +3,7 @@ -- Unique indexes need to be handled with INSERT SELECT since just running -- the CREATE INDEX statement will fail if there are duplicate values. -- --- Ignore duplicates, several tables will have them (e.g. bug 16966) but in +-- Ignore duplicates, several tables will have them (e.g. bug 16966) but in -- most cases it's harmless to discard them. -------------------------------------------------------------------------------- @@ -41,7 +41,6 @@ CREATE TABLE /*_*/user_tmp ( user_newpassword tinyblob NOT NULL, user_newpass_time binary(14), user_email tinytext NOT NULL, - user_options blob NOT NULL, user_touched binary(14) NOT NULL default '', user_token binary(32) NOT NULL default '', user_email_authenticated binary(14), @@ -218,7 +217,7 @@ CREATE TABLE /*_*/math_tmp ( math_outputhash varbinary(16) NOT NULL, math_html_conservativeness tinyint NOT NULL, math_html text, - math_mathml text + math_mathml text ); CREATE UNIQUE INDEX /*i*/math_inputhash ON /*_*/math_tmp (math_inputhash); diff --git a/tests/phpunit/includes/db/DatabaseSqliteTest.php b/tests/phpunit/includes/db/DatabaseSqliteTest.php index 914ab27cc0..c6c71ced57 100644 --- a/tests/phpunit/includes/db/DatabaseSqliteTest.php +++ b/tests/phpunit/includes/db/DatabaseSqliteTest.php @@ -98,7 +98,7 @@ class DatabaseSqliteTest extends MediaWikiTestCase { $this->assertEquals( 'sqlite_master', $db->tableName( 'sqlite_master' ) ); $this->assertEquals( 'foobar', $db->tableName( 'bar' ) ); } - + public function testDuplicateTableStructure() { $db = new DatabaseSqliteStandalone( ':memory:' ); $db->query( 'CREATE TABLE foo(foo, barfoo)' ); @@ -119,7 +119,7 @@ class DatabaseSqliteTest extends MediaWikiTestCase { 'Create a temporary duplicate only' ); } - + public function testDuplicateTableStructureVirtual() { $db = new DatabaseSqliteStandalone( ':memory:' ); if ( $db->getFulltextSearchModule() != 'FTS3' ) { @@ -196,8 +196,9 @@ class DatabaseSqliteTest extends MediaWikiTestCase { // Mismatches for these columns we can safely ignore $ignoredColumns = array( 'user_newtalk.user_last_timestamp', // r84185 + 'user.user_options', ); - + $currentDB = new DatabaseSqliteStandalone( ':memory:' ); $currentDB->sourceFile( "$IP/maintenance/tables.sql" ); $currentTables = $this->getTables( $currentDB ); @@ -254,7 +255,7 @@ class DatabaseSqliteTest extends MediaWikiTestCase { $maint = new FakeMaintenance(); $maint->loadParamsAndArgs( null, array( 'quiet' => 1 ) ); } - + $db = new DatabaseSqliteStandalone( ':memory:' ); $db->sourceFile( dirname( __FILE__ ) . "/sqlite/tables-$version.sql" ); $updater = DatabaseUpdater::newForDB( $db, false, $maint ); -- 2.20.1